/**
 * Author:   e20160504
 * Date:     2018/6/7 21:27
 * Description:
 */
package com.kevin.demo.exception;

import com.kevin.demo.enums.ResultEnum;

public class MyException extends RuntimeException {

    private Integer code;


    public MyException(Integer code) {
        this.code = code;
    }

    public MyException(ResultEnum e) {
        super(e.getMsg());
        this.code = e.getCode();
    }

    public MyException(String msg, Throwable e) {
        super(msg,e);
        this.code = 500;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
